const { DataTypes } = require('sequelize')
const sequelize = require('../config/database')

const Article = sequelize.define(
  'article',
  {
    art_id: {
      type: DataTypes.INTEGER.UNSIGNED,
      primaryKey: true, // 主键
      autoIncrement: true, // 自动增长
    },
    title: {
      type: DataTypes.STRING(100),
      defaultValue: '', // 默认值
    },
    content: {
      type: DataTypes.TEXT,
    },
  },
  {
    freezeTableName: true, // 设置为 true，表示不改变表名
    tableName: 'article', // 指定实际的表名为 'category'
    timestamps: false,
  }
)

module.exports = Article
